package com.happyhome.datamodel;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the room_rental database table.
 * 
 */
@Entity
@Table(name="ROOM_RENTAL")
public class RoomRental implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long idRoomRental;
	private Date checkInDate;
	private Date checkOutDate;
	private Integer monthsHires;
	private Integer persons;
	private Customer customer;
	private Room room;

	public RoomRental() {
	}


	@Id
	@Column(name="ID_ROOM_RENTAL")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getIdRoomRental() {
		return this.idRoomRental;
	}

	public void setIdRoomRental(Long idRoomRental) {
		this.idRoomRental = idRoomRental;
	}


	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CHECK_IN_DATE")
	public Date getCheckInDate() {
		return this.checkInDate;
	}

	public void setCheckInDate(Date checkInDate) {
		this.checkInDate = checkInDate;
	}


	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CHECK_OUT_DATE")
	public Date getCheckOutDate() {
		return this.checkOutDate;
	}

	public void setCheckOutDate(Date checkOutDate) {
		this.checkOutDate = checkOutDate;
	}


	@Column(name="MONTHS_HIRES")
	public Integer getMonthsHires() {
		return this.monthsHires;
	}

	public void setMonthsHires(Integer monthsHires) {
		this.monthsHires = monthsHires;
	}

	@Column(name="PERSONS")
	public Integer getPersons() {
		return this.persons;
	}

	public void setPersons(Integer persons) {
		this.persons = persons;
	}


	//bi-directional many-to-one association to Customer
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="CUSTOMER_ID")
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}


	//bi-directional many-to-one association to Room
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="ROOM_ID")
	public Room getRoom() {
		return this.room;
	}

	public void setRoom(Room room) {
		this.room = room;
	}

}